function get_brake_pattern_offset(limit_speed)
{
	return 0;
}

function get_incoming_pattern_offset(limit_speed)
{
	return 0;
}

function lookup_brake_pattern(limit_speed, accum_distance, target_distance, offset_distance)
{
	local brake_pattern_table = 
	{
		[0] = 10.0,
		[1] = 10.0,
		[2] = 10.0,
		[3] = 10.0,
		[4] = 10.0,
		[5] = 10.73312629,
		[6] = 11.75755077,
		[7] = 12.69960629,
		[8] = 13.5764502,
		[9] = 14.4,
		[10] = 15.17893277,
		[11] = 15.91979899,
		[12] = 16.62768775,
		[13] = 17.30664612,
		[14] = 17.95995546,
		[15] = 18.59032006,
		[16] = 19.2,
		[17] = 19.790907,
		[18] = 20.3646753,
		[19] = 20.92271493,
		[20] = 21.46625258,
		[21] = 21.99636334,
		[22] = 22.51399565,
		[23] = 23.01999131,
		[24] = 23.51510153,
		[25] = 24,
		[26] = 24.47529367,
		[27] = 24.94153163,
		[28] = 25.39921259,
		[29] = 25.84879107,
		[30] = 26.29068276,
		[31] = 26.72526894,
		[32] = 27.1529004,
		[33] = 27.5739007,
		[34] = 27.9885691,
		[35] = 28.39718296,
		[36] = 28.8,
		[37] = 29.19726015,
		[38] = 29.58918721,
		[39] = 29.97599039,
		[40] = 30.35786554,
		[41] = 30.73499634,
		[42] = 31.10755535,
		[43] = 31.47570492,
		[44] = 31.83959799,
		[45] = 32.19937888,
		[46] = 32.55518392,
		[47] = 32.90714208,
		[48] = 33.25537551,
		[49] = 33.6,
		[50] = 33.9411255,
		[51] = 34.27885646,
		[52] = 34.61329224,
		[53] = 34.94452747,
		[54] = 35.2726523,
		[55] = 35.59775274,
		[56] = 35.91991091,
		[57] = 36.23920529,
		[58] = 36.55571091,
		[59] = 36.86949959,
		[60] = 37.18064012,
		[61] = 37.48919844,
		[62] = 37.7952378,
		[63] = 38.09881888,
		[64] = 38.4,
		[65] = 38.69883719,
		[66] = 38.99538434,
		[67] = 39.2896933,
		[68] = 39.58181401,
		[69] = 39.87179454,
		[70] = 40.15968127,
		[71] = 40.44551891,
		[72] = 40.7293506,
		[73] = 41.01121798,
		[74] = 41.29116128,
		[75] = 41.56921938,
		[76] = 41.84542986,
		[77] = 42.11982906,
		[78] = 42.39245216,
		[79] = 42.6633332,
		[80] = 42.93250517,
		[81] = 43.2,
		[82] = 43.46584866,
		[83] = 43.73008118,
		[84] = 43.99272667,
		[85] = 44.2538134,
		[86] = 44.51336878,
		[87] = 44.77141945,
		[88] = 45.02799129,
		[89] = 45.28310943,
		[90] = 45.53679831,
		[91] = 45.78908167,
		[92] = 46.03998262,
		[93] = 46.28952365,
		[94] = 46.53772663,
		[95] = 46.78461286,
		[96] = 47.03020306,
		[97] = 47.27451745,
		[98] = 47.5175757,
		[99] = 47.75939698,
		[100] = 48,
		[101] = 48.23940298,
		[102] = 48.4776237,
		[103] = 48.71467951,
		[104] = 48.95058733,
		[105] = 49.18536368,
		[106] = 49.41902468,
		[107] = 49.65158608,
		[108] = 49.88306326,
		[109] = 50.11347124,
		[110] = 50.34282471,
		[111] = 50.57113801,
		[112] = 50.79842517,
		[113] = 51.0246999,
		[114] = 51.24997561,
		[115] = 51.47426541,
		[116] = 51.69758215,
		[117] = 51.91993837,
		[118] = 52.14134636,
		[119] = 52.36181815,
		[120] = 52.58136552,
		[121] = 52.8,
		[122] = 53.01773288,
		[123] = 53.23457523,
		[124] = 53.45053788,
		[125] = 53.66563146,
		[126] = 53.87986637,
		[127] = 54.09325281,
		[128] = 54.3058008,
		[129] = 54.51752012,
		[130] = 54.7284204,
		[131] = 54.93851108,
		[132] = 55.14780141,
		[133] = 55.35630045,
		[134] = 55.56401713,
		[135] = 55.77096019,
		[136] = 55.97713819,
		[137] = 56.18255957,
		[138] = 56.3872326,
		[139] = 56.59116539,
		[140] = 56.79436592,
		[141] = 56.99684202,
		[142] = 57.19860138,
		[143] = 57.39965157,
		[144] = 57.6,
		[145] = 57.79965398,
		[146] = 57.99862067,
		[147] = 58.19690713,
		[148] = 58.39452029,
		[149] = 58.59146696,
		[150] = 58.78775383,
		[151] = 58.98338749,
		[152] = 59.17837443,
		[153] = 59.37272101,
		[154] = 59.5664335,
		[155] = 59.75951807,
		[156] = 59.95198078,
		[157] = 60.14382761,
		[158] = 60.33506443,
		[159] = 60.52569702,
		[160] = 60.71573108,
		[161] = 60.90517219,
		[162] = 61.09402589,
		[163] = 61.28229761,
		[164] = 61.46999268,
		[165] = 61.65711638,
		[166] = 61.84367389,
		[167] = 62.02967032,
		[168] = 62.2151107,
		[169] = 62.4,
		[170] = 62.58434309,
		[171] = 62.76814479,
		[172] = 62.95140983,
		[173] = 63.1341429,
		[174] = 63.3163486,
		[175] = 63.49803147,
		[176] = 63.67919597,
		[177] = 63.85984654,
		[178] = 64.03998751,
		[179] = 64.21962317,
		[180] = 64.39875775,
		[181] = 64.57739543,
		[182] = 64.7555403,
		[183] = 64.93319644,
		[184] = 65.11036784,
		[185] = 65.28705844,
		[186] = 65.46327215,
		[187] = 65.63901279,
		[188] = 65.81428416,
		[189] = 65.98909001,
		[190] = 66.16343401,
		[191] = 66.33731981,
		[192] = 66.51075101,
		[193] = 66.68373115,
		[194] = 66.85626373,
		[195] = 67.02835221,
		[196] = 67.2,
		[197] = 67.37121047,
		[198] = 67.54198694,
		[199] = 67.7123327,
		[200] = 67.88225099,
		[201] = 68.05174502,
		[202] = 68.22081794,
		[203] = 68.38947287,
		[204] = 68.55771291,
		[205] = 68.7255411,
		[206] = 68.89296045,
		[207] = 69.05997394,
		[208] = 69.22658449,
		[209] = 69.39279502,
		[210] = 69.55860838,
		[211] = 69.72402742,
		[212] = 69.88905494,
		[213] = 70.05369369,
		[214] = 70.21794642,
		[215] = 70.38181583,
		[216] = 70.54530459,
		[217] = 70.70841534,
		[218] = 70.87115069,
		[219] = 71.03351322,
		[220] = 71.19550548,
		[221] = 71.35712999,
		[222] = 71.51838924,
		[223] = 71.67928571,
		[224] = 71.83982183,
		[225] = 72,
		[226] = 72.15982262,
		[227] = 72.31929203,
		[228] = 72.47841058,
		[229] = 72.63718056,
		[230] = 72.79560426,
		[231] = 72.95368394,
		[232] = 73.11142182,
		[233] = 73.26882011,
		[234] = 73.425881,
		[235] = 73.58260664,
		[236] = 73.73899918,
		[237] = 73.89506073,
		[238] = 74.05079338,
		[239] = 74.2061992,
		[240] = 74.36128025,
		[241] = 74.51603854,
		[242] = 74.67047609,
		[243] = 74.82459489,
		[244] = 74.97839689,
		[245] = 75.13188404,
		[246] = 75.28505828,
		[247] = 75.4379215,
		[248] = 75.59047559,
		[249] = 75.74272242,
		[250] = 75.89466384,
		[251] = 76.04630169,
		[252] = 76.19763776,
		[253] = 76.34867386,
		[254] = 76.49941176,
		[255] = 76.64985323,
		[256] = 76.8,
		[257] = 76.9498538,
		[258] = 77.09941634,
		[259] = 77.24868931,
		[260] = 77.39767438,
		[261] = 77.54637322,
		[262] = 77.69478747,
		[263] = 77.84291875,
		[264] = 77.99076868,
		[265] = 78.13833886,
		[266] = 78.28563087,
		[267] = 78.43264626,
		[268] = 78.57938661,
		[269] = 78.72585344,
		[270] = 78.87204828,
		[271] = 79.01797264,
		[272] = 79.16362801,
		[273] = 79.30901588,
		[274] = 79.45413771,
		[275] = 79.59899497,
		[276] = 79.74358908,
		[277] = 79.88792149,
		[278] = 80.0319936,
		[279] = 80.17580682,
		[280] = 80.31936255,
		[281] = 80.46266215,
		[282] = 80.60570699,
		[283] = 80.74849844,
		[284] = 80.89103782,
		[285] = 81.03332648,
		[286] = 81.17536572,
		[287] = 81.31715686,
		[288] = 81.45870119,
		[289] = 81.6,
		[290] = 81.74105456,
		[291] = 81.88186612,
		[292] = 82.02243596,
		[293] = 82.16276529,
		[294] = 82.30285536,
		[295] = 82.44270738,
		[296] = 82.58232256,
		[297] = 82.72170211,
		[298] = 82.86084721,
		[299] = 82.99975904,
		[300] = 83.13843876,
		[301] = 83.27688755,
		[302] = 83.41510655,
		[303] = 83.55309689,
		[304] = 83.69085972,
		[305] = 83.82839614,
		[306] = 83.96570729,
		[307] = 84.10279425,
		[308] = 84.23965812,
		[309] = 84.37629999,
		[310] = 84.51272094,
		[311] = 84.64892203,
		[312] = 84.78490432,
		[313] = 84.92066886,
		[314] = 85.0562167,
		[315] = 85.19154888,
		[316] = 85.32666641,
		[317] = 85.46157031,
		[318] = 85.5962616,
		[319] = 85.73074128,
		[320] = 85.86501034,
		[321] = 85.99906976,
		[322] = 86.13292054,
		[323] = 86.26656363,
		[324] = 86.4,
		[325] = 86.53323061,
		[326] = 86.66625641,
		[327] = 86.79907834,
		[328] = 86.93169733,
		[329] = 87.06411431,
		[330] = 87.1963302,
		[331] = 87.32834591,
		[332] = 87.46016236,
		[333] = 87.59178044,
		[334] = 87.72320104,
		[335] = 87.85442505,
		[336] = 87.98545334,
		[337] = 88.1162868,
		[338] = 88.24692629,
		[339] = 88.37737267,
		[340] = 88.50762679,
		[341] = 88.6376895,
		[342] = 88.76756164,
		[343] = 88.89724405,
		[344] = 89.02673756,
		[345] = 89.15604298,
		[346] = 89.28516114,
		[347] = 89.41409285,
		[348] = 89.54283891,
		[349] = 89.67140012,
		[350] = 89.79977728,
		[351] = 89.92797118,
		[352] = 90.05598259,
		[353] = 90.18381229,
		[354] = 90.31146107,
		[355] = 90.43892967,
		[356] = 90.56621887,
		[357] = 90.69332941,
		[358] = 90.82026206,
		[359] = 90.94701754,
		[360] = 91.07359661,
		[361] = 91.2,
		[362] = 91.32622843,
		[363] = 91.45228264,
		[364] = 91.57816334,
		[365] = 91.70387124,
		[366] = 91.82940705,
		[367] = 91.95477149,
		[368] = 92.07996525,
		[369] = 92.20498902,
		[370] = 92.3298435,
		[371] = 92.45452936,
		[372] = 92.57904731,
		[373] = 92.703398,
		[374] = 92.82758211,
		[375] = 92.95160031,
		[376] = 93.07545326,
		[377] = 93.19914163,
		[378] = 93.32266606,
		[379] = 93.4460272,
		[380] = 93.56922571,
		[381] = 93.69226222,
		[382] = 93.81513737,
		[383] = 93.9378518,
		[384] = 94.06040612,
		[385] = 94.18280098,
		[386] = 94.30503698,
		[387] = 94.42711475,
		[388] = 94.5490349,
		[389] = 94.67079803,
		[390] = 94.79240476,
		[391] = 94.91385568,
		[392] = 95.03515139,
		[393] = 95.15629249,
		[394] = 95.27727956,
		[395] = 95.39811319,
		[396] = 95.51879396,
		[397] = 95.63932246,
		[398] = 95.75969925,
		[399] = 95.87992491,
		[400] = 96,
		[401] = 96.11992509,
		[402] = 96.23970075,
		[403] = 96.35932752,
		[404] = 96.47880596,
		[405] = 96.59813663,
		[406] = 96.71732006,
		[407] = 96.83635681,
		[408] = 96.95524741,
		[409] = 97.0739924,
		[410] = 97.19259231,
		[411] = 97.31104768,
		[412] = 97.42935902,
		[413] = 97.54752688,
		[414] = 97.66555176,
		[415] = 97.78343418,
		[416] = 97.90117466,
		[417] = 98.01877371,
		[418] = 98.13623184,
		[419] = 98.25354955,
		[420] = 98.37072735,
		[421] = 98.48776574,
		[422] = 98.6046652,
		[423] = 98.72142625,
		[424] = 98.83804935,
		[425] = 98.95453501,
		[426] = 99.07088371,
		[427] = 99.18709593,
		[428] = 99.30317215,
		[429] = 99.41911285,
		[430] = 99.5349185,
		[431] = 99.65058956,
		[432] = 99.76612652,
		[433] = 99.88152982,
		[434] = 99.99679995,
		[435] = 100.1119374,
		[436] = 100.2269425,
		[437] = 100.3418158,
		[438] = 100.4565578,
		[439] = 100.5711688,
		[440] = 100.6856494,
		[441] = 100.8,
		[442] = 100.914221,
		[443] = 101.0283129,
		[444] = 101.142276,
		[445] = 101.2561109,
		[446] = 101.369818,
		[447] = 101.4833977,
		[448] = 101.5968503,
		[449] = 101.7101765,
		[450] = 101.8233765,
		[451] = 101.9364508,
		[452] = 102.0493998,
		[453] = 102.1622239,
		[454] = 102.2749236,
		[455] = 102.3874992,
		[456] = 102.4999512,
		[457] = 102.61228,
		[458] = 102.7244859,
		[459] = 102.8365694,
		[460] = 102.9485308,
		[461] = 103.0603707,
		[462] = 103.1720892,
		[463] = 103.283687,
		[464] = 103.3951643,
		[465] = 103.5065215,
		[466] = 103.6177591,
		[467] = 103.7288774,
		[468] = 103.8398767,
		[469] = 103.9507576,
		[470] = 104.0615203,
		[471] = 104.1721652,
		[472] = 104.2826927,
		[473] = 104.3931032,
		[474] = 104.5033971,
		[475] = 104.6135746,
		[476] = 104.7236363,
		[477] = 104.8335824,
		[478] = 104.9434133,
		[479] = 105.0531294,
		[480] = 105.162731,
		[481] = 105.2722186,
		[482] = 105.3815923,
		[483] = 105.4908527,
		[484] = 105.6,
		[485] = 105.7090346,
		[486] = 105.8179569,
		[487] = 105.9267672,
		[488] = 106.0354658,
		[489] = 106.1440531,
		[490] = 106.2525294,
		[491] = 106.3608951,
		[492] = 106.4691505,
		[493] = 106.5772959,
		[494] = 106.6853317,
		[495] = 106.7932582,
		[496] = 106.9010758,
		[497] = 107.0087847,
		[498] = 107.1163853,
		[499] = 107.2238779,
		[500] = 107.3312629,
		[501] = 107.4385406,
		[502] = 107.5457112,
		[503] = 107.6527752,
		[504] = 107.7597327,
		[505] = 107.8665843,
		[506] = 107.97333,
		[507] = 108.0799704,
		[508] = 108.1865056,
		[509] = 108.2929361,
		[510] = 108.399262,
		[511] = 108.5054837,
		[512] = 108.6116016,
		[513] = 108.7176159,
		[514] = 108.8235269,
		[515] = 108.9293349,
		[516] = 109.0350402,
		[517] = 109.1406432,
		[518] = 109.2461441,
		[519] = 109.3515432,
		[520] = 109.4568408,
		[521] = 109.5620372,
		[522] = 109.6671327,
		[523] = 109.7721276,
		[524] = 109.8770222,
		[525] = 109.9818167,
		[526] = 110.0865114,
		[527] = 110.1911067,
		[528] = 110.2956028,
		[529] = 110.4,
		[530] = 110.5042986,
		[531] = 110.6084988,
		[532] = 110.7126009,
		[533] = 110.8166053,
		[534] = 110.9205121,
		[535] = 111.0243217,
		[536] = 111.1280343,
		[537] = 111.2316502,
		[538] = 111.3351696,
		[539] = 111.438593,
		[540] = 111.5419204,
		[541] = 111.6451522,
		[542] = 111.7482886,
		[543] = 111.8513299,
		[544] = 111.9542764,
		[545] = 112.0571283,
		[546] = 112.1598859,
		[547] = 112.2625494,
		[548] = 112.3651191,
		[549] = 112.4675953,
		[550] = 112.5699782,
		[551] = 112.6722681,
		[552] = 112.7744652,
		[553] = 112.8765698,
		[554] = 112.978582,
		[555] = 113.0805023,
		[556] = 113.1823308,
		[557] = 113.2840677,
		[558] = 113.3857134,
		[559] = 113.487268,
		[560] = 113.5887318,
		[561] = 113.6901051,
		[562] = 113.7913881,
		[563] = 113.892581,
		[564] = 113.993684,
		[565] = 114.0946975,
		[566] = 114.1956216,
		[567] = 114.2964566,
		[568] = 114.3972028,
		[569] = 114.4978602,
		[570] = 114.5984293,
		[571] = 114.6989102,
		[572] = 114.7993031,
		[573] = 114.8996084,
		[574] = 114.9998261,
		[575] = 115.0999566,
		[576] = 115.2,
		[577] = 115.2999566,
		[578] = 115.3998267,
		[579] = 115.4996104,
		[580] = 115.599308,
		[581] = 115.6989196,
		[582] = 115.7984456,
		[583] = 115.8978861,
		[584] = 115.9972413,
		[585] = 116.0965116,
		[586] = 116.195697,
		[587] = 116.2947978,
		[588] = 116.3938143,
		[589] = 116.4927466,
		[590] = 116.5915949,
		[591] = 116.6903595,
		[592] = 116.7890406,
		[593] = 116.8876384,
		[594] = 116.986153,
		[595] = 117.0845848,
		[596] = 117.1829339,
		[597] = 117.2812005,
		[598] = 117.3793849,
		[599] = 117.4774872,
		[600] = 117.5755077,
		[601] = 117.6734465,
		[602] = 117.7713038,
		[603] = 117.8690799,
		[604] = 117.966775,
		[605] = 118.0643892,
		[606] = 118.1619228,
		[607] = 118.2593759,
		[608] = 118.3567489,
		[609] = 118.4540417,
		[610] = 118.5512547,
		[611] = 118.6483881,
		[612] = 118.745442,
		[613] = 118.8424167,
		[614] = 118.9393123,
		[615] = 119.036129,
		[616] = 119.132867,
		[617] = 119.2295265,
		[618] = 119.3261078,
		[619] = 119.4226109,
		[620] = 119.5190361,
		[621] = 119.6153836,
		[622] = 119.7116536,
		[623] = 119.8078462,
		[624] = 119.9039616,
		[625] = 120,
		[626] = 120.0959616,
		[627] = 120.1918466,
		[628] = 120.2876552,
		[629] = 120.3833876,
		[630] = 120.4790438,
		[631] = 120.5746242,
		[632] = 120.6701289,
		[633] = 120.765558,
		[634] = 120.8609118,
		[635] = 120.9561904,
		[636] = 121.051394,
		[637] = 121.1465229,
		[638] = 121.241577,
		[639] = 121.3365567,
		[640] = 121.4314622,
		[641] = 121.5262935,
		[642] = 121.6210508,
		[643] = 121.7157344,
		[644] = 121.8103444,
		[645] = 121.904881,
		[646] = 121.9993443,
		[647] = 122.0937345,
		[648] = 122.1880518,
		[649] = 122.2822963,
		[650] = 122.3764683,
		[651] = 122.4705679,
		[652] = 122.5645952,
		[653] = 122.6585505,
		[654] = 122.7524338,
		[655] = 122.8462454,
		[656] = 122.9399854,
		[657] = 123.0336539,
		[658] = 123.1272512,
		[659] = 123.2207775,
		[660] = 123.3142328,
		[661] = 123.4076173,
		[662] = 123.5009312,
		[663] = 123.5941746,
		[664] = 123.6873478,
		[665] = 123.7804508,
		[666] = 123.8734838,
		[667] = 123.9664471,
		[668] = 124.0593406,
		[669] = 124.1521647,
		[670] = 124.2449194,
		[671] = 124.3376049,
		[672] = 124.4302214,
		[673] = 124.522769,
		[674] = 124.6152479,
		[675] = 124.7076581,
		[676] = 124.8,
		[677] = 124.8922736,
		[678] = 124.984479,
		[679] = 125.0766165,
		[680] = 125.1686862,
		[681] = 125.2606882,
		[682] = 125.3526226,
		[683] = 125.4444897,
		[684] = 125.5362896,
		[685] = 125.6280224,
		[686] = 125.7196882,
		[687] = 125.8112873,
		[688] = 125.9028197,
		[689] = 125.9942856,
		[690] = 126.0856852,
		[691] = 126.1770185,
		[692] = 126.2682858,
		[693] = 126.3594872,
		[694] = 126.4506228,
		[695] = 126.5416927,
		[696] = 126.6326972,
		[697] = 126.7236363,
		[698] = 126.8145102,
		[699] = 126.905319,
		[700] = 126.9960629,
		[701] = 127.086742,
		[702] = 127.1773565,
		[703] = 127.2679064,
		[704] = 127.3583919,
		[705] = 127.4488133,
		[706] = 127.5391705,
		[707] = 127.6294637,
		[708] = 127.7196931,
		[709] = 127.8098588,
		[710] = 127.8999609,
		[711] = 127.9899996,
		[712] = 128.079975,
		[713] = 128.1698873,
		[714] = 128.2597365,
		[715] = 128.3495228,
		[716] = 128.4392463,
		[717] = 128.5289073,
		[718] = 128.6185057,
		[719] = 128.7080417,
		[720] = 128.7975155,
		[721] = 128.8869272,
		[722] = 128.9762769,
		[723] = 129.0655647,
		[724] = 129.1547909,
		[725] = 129.2439554,
		[726] = 129.3330584,
		[727] = 129.4221001,
		[728] = 129.5110806,
		[729] = 129.6,
		[730] = 129.6888584,
		[731] = 129.777656,
		[732] = 129.8663929,
		[733] = 129.9550692,
		[734] = 130.043685,
		[735] = 130.1322404,
		[736] = 130.2207357,
		[737] = 130.3091708,
		[738] = 130.397546,
		[739] = 130.4858613,
		[740] = 130.5741169,
		[741] = 130.6623129,
		[742] = 130.7504493,
		[743] = 130.8385264,
		[744] = 130.9265443,
		[745] = 131.014503,
		[746] = 131.1024027,
		[747] = 131.1902435,
		[748] = 131.2780256,
		[749] = 131.365749,
		[750] = 131.4534138,
		[751] = 131.5410202,
		[752] = 131.6285683,
		[753] = 131.7160582,
		[754] = 131.8034901,
		[755] = 131.890864,
		[756] = 131.97818,
		[757] = 132.0654383,
		[758] = 132.152639,
		[759] = 132.2397822,
		[760] = 132.326868,
		[761] = 132.4138966,
		[762] = 132.5008679,
		[763] = 132.5877822,
		[764] = 132.6746396,
		[765] = 132.7614402,
		[766] = 132.848184,
		[767] = 132.9348713,
		[768] = 133.021502,
		[769] = 133.1080764,
		[770] = 133.1945945,
		[771] = 133.2810564,
		[772] = 133.3674623,
		[773] = 133.4538122,
		[774] = 133.5401063,
		[775] = 133.6263447,
		[776] = 133.7125275,
		[777] = 133.7986547,
		[778] = 133.8847265,
		[779] = 133.9707431,
		[780] = 134.0567044,
		[781] = 134.1426107,
		[782] = 134.228462,
		[783] = 134.3142584,
		[784] = 134.4,
		[785] = 134.485687,
		[786] = 134.5713194,
		[787] = 134.6568973,
		[788] = 134.7424209,
		[789] = 134.8278903,
		[790] = 134.9133055,
		[791] = 134.9986667,
		[792] = 135.0839739,
		[793] = 135.1692273,
		[794] = 135.2544269,
		[795] = 135.3395729,
		[796] = 135.4246654,
		[797] = 135.5097044,
		[798] = 135.5946902,
		[799] = 135.6796226,
		[800] = 135.764502,
		[801] = 135.8493283,
		[802] = 135.9341017,
		[803] = 136.0188222,
		[804] = 136.10349,
		[805] = 136.1881052,
		[806] = 136.2726678,
		[807] = 136.357178,
		[808] = 136.4416359,
		[809] = 136.5260415,
		[810] = 136.6103949,
		[811] = 136.6946963,
		[812] = 136.7789457,
		[813] = 136.8631433,
		[814] = 136.9472891,
		[815] = 137.0313833,
		[816] = 137.1154258,
		[817] = 137.1994169,
		[818] = 137.2833566,
		[819] = 137.367245,
		[820] = 137.4510822,
		[821] = 137.5348683,
		[822] = 137.6186034,
		[823] = 137.7022876,
		[824] = 137.7859209,
		[825] = 137.8695035,
		[826] = 137.9530355,
		[827] = 138.0365169,
		[828] = 138.1199479,
		[829] = 138.2033285,
		[830] = 138.2866588,
		[831] = 138.3699389,
		[832] = 138.453169,
		[833] = 138.536349,
		[834] = 138.6194792,
		[835] = 138.7025595,
		[836] = 138.78559,
		[837] = 138.868571,
		[838] = 138.9515023,
		[839] = 139.0343842,
		[840] = 139.1172168,
		[841] = 139.2,
		[842] = 139.282734,
		[843] = 139.365419,
		[844] = 139.4480548,
		[845] = 139.5306418,
		[846] = 139.6131799,
		[847] = 139.6956692,
		[848] = 139.7781099,
		[849] = 139.8605019,
		[850] = 139.9428455,
		[851] = 140.0251406,
		[852] = 140.1073874,
		[853] = 140.1895859,
		[854] = 140.2717363,
		[855] = 140.3538386,
		[856] = 140.4358928,
		[857] = 140.5178992,
		[858] = 140.5998578,
		[859] = 140.6817685,
		[860] = 140.7636317,
		[861] = 140.8454472,
		[862] = 140.9272153,
		[863] = 141.0089359,
		[864] = 141.0906092,
		[865] = 141.1722352,
		[866] = 141.2538141,
		[867] = 141.3353459,
		[868] = 141.4168307,
		[869] = 141.4982685,
		[870] = 141.5796596,
		[871] = 141.6610038,
		[872] = 141.7423014,
		[873] = 141.8235523,
		[874] = 141.9047568,
		[875] = 141.9859148,
		[876] = 142.0670264,
		[877] = 142.1480918,
		[878] = 142.2291109,
		[879] = 142.310084,
		[880] = 142.391011,
		[881] = 142.471892,
		[882] = 142.5527271,
		[883] = 142.6335164,
		[884] = 142.71426,
		[885] = 142.7949579,
		[886] = 142.8756102,
		[887] = 142.9562171,
		[888] = 143.0367785,
		[889] = 143.1172946,
		[890] = 143.1977653,
		[891] = 143.2781909,
		[892] = 143.3585714,
		[893] = 143.4389069,
		[894] = 143.5191973,
		[895] = 143.5994429,
		[896] = 143.6796437,
		[897] = 143.7597997,
		[898] = 143.839911,
		[899] = 143.9199778,
		[900] = 144,
		[901] = 144.0799778,
		[902] = 144.1599112,
		[903] = 144.2398003,
		[904] = 144.3196452,
		[905] = 144.399446,
		[906] = 144.4792027,
		[907] = 144.5589153,
		[908] = 144.6385841,
		[909] = 144.7182089,
		[910] = 144.79779,
		[911] = 144.8773274,
		[912] = 144.9568212,
		[913] = 145.0362713,
		[914] = 145.115678,
		[915] = 145.1950412,
		[916] = 145.2743611,
		[917] = 145.3536377,
		[918] = 145.4328711,
		[919] = 145.5120614,
		[920] = 145.5912085,
		[921] = 145.6703127,
		[922] = 145.7493739,
		[923] = 145.8283923,
		[924] = 145.9073679,
		[925] = 145.9863007,
		[926] = 146.0651909,
		[927] = 146.1440385,
		[928] = 146.2228436,
		[929] = 146.3016063,
		[930] = 146.3803265,
		[931] = 146.4590045,
		[932] = 146.5376402,
		[933] = 146.6162338,
		[934] = 146.6947852,
		[935] = 146.7732946,
		[936] = 146.851762,
		[937] = 146.9301875,
		[938] = 147.0085712,
		[939] = 147.0869131,
		[940] = 147.1652133,
		[941] = 147.2434718,
		[942] = 147.3216888,
		[943] = 147.3998643,
		[944] = 147.4779984,
		[945] = 147.556091,
		[946] = 147.6341424,
		[947] = 147.7121525,
		[948] = 147.7901215,
		[949] = 147.8680493,
		[950] = 147.9459361,
		[951] = 148.0237819,
		[952] = 148.1015868,
		[953] = 148.1793508,
		[954] = 148.257074,
		[955] = 148.3347565,
		[956] = 148.4123984,
		[957] = 148.4899997,
		[958] = 148.5675604,
		[959] = 148.6450806,
		[960] = 148.7225605,
		[961] = 148.8,
		[962] = 148.8773992,
		[963] = 148.9547582,
		[964] = 149.0320771,
		[965] = 149.1093558,
		[966] = 149.1865946,
		[967] = 149.2637933,
		[968] = 149.3409522,
		[969] = 149.4180712,
		[970] = 149.4951504,
		[971] = 149.5721899,
		[972] = 149.6491898,
		[973] = 149.72615,
		[974] = 149.8030707,
		[975] = 149.879952,
		[976] = 149.9567938,
		[977] = 150.0335962,
		[978] = 150.1103594,
		[979] = 150.1870833,
		[980] = 150.2637681,
		[981] = 150.3404137,
		[982] = 150.4170203,
		[983] = 150.4935879,
		[984] = 150.5701166,
		[985] = 150.6466063,
		[986] = 150.7230573,
		[987] = 150.7994695,
		[988] = 150.875843,
		[989] = 150.9521779,
		[990] = 151.0284741,
		[991] = 151.1047319,
		[992] = 151.1809512,
		[993] = 151.2571321,
		[994] = 151.3332746,
		[995] = 151.4093788,
		[996] = 151.4854448,
		[997] = 151.5614727,
		[998] = 151.6374624,
		[999] = 151.713414,
		[1000] = 151.7893277,
	};

	local true_idx = (target_distance - accum_distance);

	if (true_idx <= 0)
	{
		return 15.0;
	}
	else if (true_idx > 1000)
	{
		return brake_pattern_table[1000];
	}
	else
	{
		return brake_pattern_table[true_idx.tointeger()];
	}
}

function lookup_incoming_pattern(limit_speed, accum_distance, target_distance, offset_distance)
{
	local incoming_pattern_table = 
	{
		[0] = 5.0,
		[1] = 5.0,
		[2] = 5.0,
		[3] = 5.0,
		[4] = 5.0,
		[5] = 5.305338422,
		[6] = 6.288932633,
		[7] = 7.19344086,
		[8] = 8.035336589,
		[9] = 8.826062346,
		[10] = 9.573949362,
		[11] = 10.28528704,
		[12] = 10.96496163,
		[13] = 11.61685891,
		[14] = 12.24412944,
		[15] = 12.84936974,
		[16] = 13.43474979,
		[17] = 14.00210515,
		[18] = 14.55300488,
		[19] = 15.08880285,
		[20] = 15.61067684,
		[21] = 16.11965909,
		[22] = 16.61666024,
		[23] = 17.10248855,
		[24] = 17.57786527,
		[25] = 18.04343724,
		[26] = 18.49978723,
		[27] = 18.94744245,
		[28] = 19.38688172,
		[29] = 19.81854146,
		[30] = 20.24282076,
		[31] = 20.66008574,
		[32] = 21.07067318,
		[33] = 21.47489377,
		[34] = 21.87303481,
		[35] = 22.26536264,
		[36] = 22.65212469,
		[37] = 23.03355133,
		[38] = 23.40985744,
		[39] = 23.78124389,
		[40] = 24.14789872,
		[41] = 24.50999831,
		[42] = 24.86770832,
		[43] = 25.22118462,
		[44] = 25.57057409,
		[45] = 25.91601527,
		[46] = 26.25763907,
		[47] = 26.59556931,
		[48] = 26.92992327,
		[49] = 27.26081214,
		[50] = 27.58834147,
		[51] = 27.91261156,
		[52] = 28.23371782,
		[53] = 28.55175107,
		[54] = 28.8667979,
		[55] = 29.17894088,
		[56] = 29.48825887,
		[57] = 29.7948272,
		[58] = 30.09871793,
		[59] = 30.4,
		[60] = 30.69873947,
		[61] = 30.99499965,
		[62] = 31.28884126,
		[63] = 31.58032258,
		[64] = 31.86949959,
		[65] = 32.15642609,
		[66] = 32.44115383,
		[67] = 32.72373258,
		[68] = 33.00421029,
		[69] = 33.28263314,
		[70] = 33.55904563,
		[71] = 33.8334907,
		[72] = 34.10600977,
		[73] = 34.37664282,
		[74] = 34.64542849,
		[75] = 34.91240409,
		[76] = 35.1776057,
		[77] = 35.44106824,
		[78] = 35.70282545,
		[79] = 35.96291005,
		[80] = 36.22135369,
		[81] = 36.47818704,
		[82] = 36.73343983,
		[83] = 36.98714089,
		[84] = 37.23931818,
		[85] = 37.48999882,
		[86] = 37.73920916,
		[87] = 37.98697477,
		[88] = 38.23332048,
		[89] = 38.47827043,
		[90] = 38.72184809,
		[91] = 38.96407624,
		[92] = 39.2049771,
		[93] = 39.44457222,
		[94] = 39.68288263,
		[95] = 39.91992876,
		[96] = 40.15573053,
		[97] = 40.39030734,
		[98] = 40.62367806,
		[99] = 40.85586113,
		[100] = 41.08687449,
		[101] = 41.31673564,
		[102] = 41.54546165,
		[103] = 41.77306917,
		[104] = 41.99957447,
		[105] = 42.22499338,
		[106] = 42.44934141,
		[107] = 42.67263366,
		[108] = 42.8948849,
		[109] = 43.11610957,
		[110] = 43.33632175,
		[111] = 43.55553521,
		[112] = 43.77376344,
		[113] = 43.99101959,
		[114] = 44.20731653,
		[115] = 44.42266686,
		[116] = 44.63708291,
		[117] = 44.85057673,
		[118] = 45.06316011,
		[119] = 45.2748446,
		[120] = 45.48564152,
		[121] = 45.69556194,
		[122] = 45.90461669,
		[123] = 46.1128164,
		[124] = 46.32017147,
		[125] = 46.52669211,
		[126] = 46.73238831,
		[127] = 46.93726986,
		[128] = 47.14134636,
		[129] = 47.34462723,
		[130] = 47.54712171,
		[131] = 47.74883885,
		[132] = 47.94978753,
		[133] = 48.14997648,
		[134] = 48.34941424,
		[135] = 48.54810921,
		[136] = 48.74606962,
		[137] = 48.94330357,
		[138] = 49.13981899,
		[139] = 49.33562367,
		[140] = 49.53072528,
		[141] = 49.72513134,
		[142] = 49.91884922,
		[143] = 50.1118862,
		[144] = 50.30424938,
		[145] = 50.4959458,
		[146] = 50.68698232,
		[147] = 50.87736572,
		[148] = 51.06710265,
		[149] = 51.25619966,
		[150] = 51.44466317,
		[151] = 51.6324995,
		[152] = 51.81971489,
		[153] = 52.00631544,
		[154] = 52.19230718,
		[155] = 52.37769602,
		[156] = 52.56248779,
		[157] = 52.74668822,
		[158] = 52.93030295,
		[159] = 53.11333754,
		[160] = 53.29579745,
		[161] = 53.47768805,
		[162] = 53.65901465,
		[163] = 53.83978246,
		[164] = 54.01999661,
		[165] = 54.19966216,
		[166] = 54.37878409,
		[167] = 54.5573673,
		[168] = 54.73541663,
		[169] = 54.91293683,
		[170] = 55.0899326,
		[171] = 55.26640855,
		[172] = 55.44236925,
		[173] = 55.61781916,
		[174] = 55.79276273,
		[175] = 55.9672043,
		[176] = 56.14114817,
		[177] = 56.31459859,
		[178] = 56.48755972,
		[179] = 56.66003568,
		[180] = 56.83203053,
		[181] = 57.00354829,
		[182] = 57.17459288,
		[183] = 57.34516822,
		[184] = 57.51527813,
		[185] = 57.68492642,
		[186] = 57.85411681,
		[187] = 58.022853,
		[188] = 58.19113862,
		[189] = 58.35897726,
		[190] = 58.52637248,
		[191] = 58.69332775,
		[192] = 58.85984654,
		[193] = 59.02593225,
		[194] = 59.19158823,
		[195] = 59.35681782,
		[196] = 59.52162428,
		[197] = 59.68601085,
		[198] = 59.84998072,
		[199] = 60.01353705,
		[200] = 60.17668295,
		[201] = 60.33942149,
		[202] = 60.5017557,
		[203] = 60.6636886,
		[204] = 60.82522313,
		[205] = 60.98636223,
		[206] = 61.14710878,
		[207] = 61.30746564,
		[208] = 61.46743564,
		[209] = 61.62702155,
		[210] = 61.78622612,
		[211] = 61.94505209,
		[212] = 62.10350214,
		[213] = 62.26157893,
		[214] = 62.41928507,
		[215] = 62.57662318,
		[216] = 62.7335958,
		[217] = 62.89020548,
		[218] = 63.04645472,
		[219] = 63.202346,
		[220] = 63.35788177,
		[221] = 63.51306445,
		[222] = 63.66789643,
		[223] = 63.82238008,
		[224] = 63.97651774,
		[225] = 64.13031173,
		[226] = 64.28376433,
		[227] = 64.43687781,
		[228] = 64.5896544,
		[229] = 64.74209633,
		[230] = 64.89420577,
		[231] = 65.0459849,
		[232] = 65.19743585,
		[233] = 65.34856075,
		[234] = 65.4993617,
		[235] = 65.64984076,
		[236] = 65.8,
		[237] = 65.94984144,
		[238] = 66.09936709,
		[239] = 66.24857893,
		[240] = 66.39747895,
		[241] = 66.54606907,
		[242] = 66.69435124,
		[243] = 66.84232736,
		[244] = 66.98999931,
		[245] = 67.13736896,
		[246] = 67.28443816,
		[247] = 67.43120874,
		[248] = 67.57768252,
		[249] = 67.72386128,
		[250] = 67.86974681,
		[251] = 68.01534085,
		[252] = 68.16064516,
		[253] = 68.30566145,
		[254] = 68.45039142,
		[255] = 68.59483678,
		[256] = 68.73899918,
		[257] = 68.88288029,
		[258] = 69.02648175,
		[259] = 69.16980518,
		[260] = 69.31285219,
		[261] = 69.45562437,
		[262] = 69.5981233,
		[263] = 69.74035055,
		[264] = 69.88230766,
		[265] = 70.02399616,
		[266] = 70.16541758,
		[267] = 70.30657342,
		[268] = 70.44746517,
		[269] = 70.5880943,
		[270] = 70.72846228,
		[271] = 70.86857057,
		[272] = 71.00842059,
		[273] = 71.14801376,
		[274] = 71.28735151,
		[275] = 71.42643522,
		[276] = 71.56526628,
		[277] = 71.70384606,
		[278] = 71.84217592,
		[279] = 71.98025721,
		[280] = 72.11809126,
		[281] = 72.2556794,
		[282] = 72.39302294,
		[283] = 72.53012318,
		[284] = 72.6669814,
		[285] = 72.80359889,
		[286] = 72.93997691,
		[287] = 73.07611671,
		[288] = 73.21201954,
		[289] = 73.34768663,
		[290] = 73.4831192,
		[291] = 73.61831848,
		[292] = 73.75328565,
		[293] = 73.8880219,
		[294] = 74.02252843,
		[295] = 74.1568064,
		[296] = 74.29085698,
		[297] = 74.4246813,
		[298] = 74.55828052,
		[299] = 74.69165577,
		[300] = 74.82480817,
		[301] = 74.95773884,
		[302] = 75.09044887,
		[303] = 75.22293936,
		[304] = 75.35521141,
		[305] = 75.48726607,
		[306] = 75.61910444,
		[307] = 75.75072755,
		[308] = 75.88213647,
		[309] = 76.01333224,
		[310] = 76.14431588,
		[311] = 76.27508843,
		[312] = 76.40565091,
		[313] = 76.53600432,
		[314] = 76.66614966,
		[315] = 76.79608793,
		[316] = 76.92582011,
		[317] = 77.05534717,
		[318] = 77.1846701,
		[319] = 77.31378985,
		[320] = 77.44270738,
		[321] = 77.57142363,
		[322] = 77.69993954,
		[323] = 77.82825605,
		[324] = 77.95637408,
		[325] = 78.08429454,
		[326] = 78.21201836,
		[327] = 78.33954644,
		[328] = 78.46687966,
		[329] = 78.59401892,
		[330] = 78.72096512,
		[331] = 78.84771911,
		[332] = 78.97428178,
		[333] = 79.10065398,
		[334] = 79.22683658,
		[335] = 79.35283042,
		[336] = 79.47863635,
		[337] = 79.60425521,
		[338] = 79.72968783,
		[339] = 79.85493504,
		[340] = 79.97999765,
		[341] = 80.10487648,
		[342] = 80.22957233,
		[343] = 80.35408602,
		[344] = 80.47841833,
		[345] = 80.60257005,
		[346] = 80.72654198,
		[347] = 80.85033489,
		[348] = 80.97394954,
		[349] = 81.09738672,
		[350] = 81.22064718,
		[351] = 81.34373168,
		[352] = 81.46664097,
		[353] = 81.58937579,
		[354] = 81.71193689,
		[355] = 81.83432501,
		[356] = 81.95654087,
		[357] = 82.0785852,
		[358] = 82.20045871,
		[359] = 82.32216214,
		[360] = 82.44369617,
		[361] = 82.56506153,
		[362] = 82.6862589,
		[363] = 82.80728899,
		[364] = 82.92815249,
		[365] = 83.04885008,
		[366] = 83.16938244,
		[367] = 83.28975025,
		[368] = 83.40995419,
		[369] = 83.52999492,
		[370] = 83.6498731,
		[371] = 83.76958939,
		[372] = 83.88914444,
		[373] = 84.00853892,
		[374] = 84.12777345,
		[375] = 84.24684868,
		[376] = 84.36576526,
		[377] = 84.4845238,
		[378] = 84.60312495,
		[379] = 84.72156931,
		[380] = 84.83985752,
		[381] = 84.9579902,
		[382] = 85.07596794,
		[383] = 85.19379136,
		[384] = 85.31146107,
		[385] = 85.42897766,
		[386] = 85.54634173,
		[387] = 85.66355387,
		[388] = 85.78061467,
		[389] = 85.89752472,
		[390] = 86.01428459,
		[391] = 86.13089487,
		[392] = 86.24735613,
		[393] = 86.36366893,
		[394] = 86.47983384,
		[395] = 86.59585143,
		[396] = 86.71172226,
		[397] = 86.82744688,
		[398] = 86.94302584,
		[399] = 87.05845969,
		[400] = 87.17374897,
		[401] = 87.28889424,
		[402] = 87.40389602,
		[403] = 87.51875486,
		[404] = 87.63347127,
		[405] = 87.7480458,
		[406] = 87.86247897,
		[407] = 87.97677129,
		[408] = 88.0909233,
		[409] = 88.20493549,
		[410] = 88.31880839,
		[411] = 88.43254251,
		[412] = 88.54613835,
		[413] = 88.65959641,
		[414] = 88.7729172,
		[415] = 88.88610121,
		[416] = 88.99914893,
		[417] = 89.11206086,
		[418] = 89.22483749,
		[419] = 89.3374793,
		[420] = 89.44998677,
		[421] = 89.56236038,
		[422] = 89.67460061,
		[423] = 89.78670793,
		[424] = 89.89868281,
		[425] = 90.01052573,
		[426] = 90.12223715,
		[427] = 90.23381752,
		[428] = 90.34526732,
		[429] = 90.45658699,
		[430] = 90.567777,
		[431] = 90.67883779,
		[432] = 90.78976981,
		[433] = 90.90057351,
		[434] = 91.01124934,
		[435] = 91.12179774,
		[436] = 91.23221914,
		[437] = 91.34251398,
		[438] = 91.4526827,
		[439] = 91.56272573,
		[440] = 91.67264349,
		[441] = 91.78243642,
		[442] = 91.89210494,
		[443] = 92.00164947,
		[444] = 92.11107043,
		[445] = 92.22036824,
		[446] = 92.32954331,
		[447] = 92.43859605,
		[448] = 92.54752688,
		[449] = 92.6563362,
		[450] = 92.76502442,
		[451] = 92.87359194,
		[452] = 92.98203917,
		[453] = 93.0903665,
		[454] = 93.19857433,
		[455] = 93.30666305,
		[456] = 93.41463306,
		[457] = 93.52248474,
		[458] = 93.63021849,
		[459] = 93.73783469,
		[460] = 93.84533373,
		[461] = 93.95271598,
		[462] = 94.05998183,
		[463] = 94.16713165,
		[464] = 94.27416582,
		[465] = 94.38108472,
		[466] = 94.48788871,
		[467] = 94.59457817,
		[468] = 94.70115345,
		[469] = 94.80761494,
		[470] = 94.91396299,
		[471] = 95.02019796,
		[472] = 95.12632022,
		[473] = 95.23233011,
		[474] = 95.33822801,
		[475] = 95.44401426,
		[476] = 95.54968921,
		[477] = 95.65525322,
		[478] = 95.76070663,
		[479] = 95.86604979,
		[480] = 95.97128305,
		[481] = 96.07640674,
		[482] = 96.18142122,
		[483] = 96.28632682,
		[484] = 96.39112387,
		[485] = 96.49581272,
		[486] = 96.6003937,
		[487] = 96.70486714,
		[488] = 96.80923337,
		[489] = 96.91349273,
		[490] = 97.01764553,
		[491] = 97.12169211,
		[492] = 97.22563279,
		[493] = 97.3294679,
		[494] = 97.43319774,
		[495] = 97.53682265,
		[496] = 97.64034295,
		[497] = 97.74375893,
		[498] = 97.84707094,
		[499] = 97.95027926,
		[500] = 98.05338422,
		[501] = 98.15638613,
		[502] = 98.2592853,
		[503] = 98.36208202,
		[504] = 98.46477662,
		[505] = 98.56736938,
		[506] = 98.66986062,
		[507] = 98.77225063,
		[508] = 98.87453971,
		[509] = 98.97672817,
		[510] = 99.07881629,
		[511] = 99.18080437,
		[512] = 99.28269272,
		[513] = 99.38448161,
		[514] = 99.48617133,
		[515] = 99.58776219,
		[516] = 99.68925446,
		[517] = 99.79064844,
		[518] = 99.8919444,
		[519] = 99.99314263,
		[520] = 100.0942434,
		[521] = 100.195247,
		[522] = 100.2961538,
		[523] = 100.3969639,
		[524] = 100.4976777,
		[525] = 100.5982954,
		[526] = 100.6988174,
		[527] = 100.7992439,
		[528] = 100.8995751,
		[529] = 100.9998113,
		[530] = 101.0999529,
		[531] = 101.2,
		[532] = 101.299953,
		[533] = 101.399812,
		[534] = 101.4995775,
		[535] = 101.5992495,
		[536] = 101.6988285,
		[537] = 101.7983146,
		[538] = 101.8977081,
		[539] = 101.9970093,
		[540] = 102.0962184,
		[541] = 102.1953357,
		[542] = 102.2943615,
		[543] = 102.3932959,
		[544] = 102.4921392,
		[545] = 102.5908918,
		[546] = 102.6895538,
		[547] = 102.7881255,
		[548] = 102.8866071,
		[549] = 102.984999,
		[550] = 103.0833012,
		[551] = 103.1815141,
		[552] = 103.279638,
		[553] = 103.377673,
		[554] = 103.4756194,
		[555] = 103.5734774,
		[556] = 103.6712473,
		[557] = 103.7689294,
		[558] = 103.8665238,
		[559] = 103.9640308,
		[560] = 104.0614506,
		[561] = 104.1587834,
		[562] = 104.2560296,
		[563] = 104.3531893,
		[564] = 104.4502627,
		[565] = 104.5472501,
		[566] = 104.6441517,
		[567] = 104.7409677,
		[568] = 104.8376984,
		[569] = 104.934344,
		[570] = 105.0309047,
		[571] = 105.1273808,
		[572] = 105.2237724,
		[573] = 105.3200798,
		[574] = 105.4163031,
		[575] = 105.5124427,
		[576] = 105.6084988,
		[577] = 105.7044715,
		[578] = 105.800361,
		[579] = 105.8961677,
		[580] = 105.9918916,
		[581] = 106.0875331,
		[582] = 106.1830922,
		[583] = 106.2785694,
		[584] = 106.3739646,
		[585] = 106.4692783,
		[586] = 106.5645105,
		[587] = 106.6596615,
		[588] = 106.7547314,
		[589] = 106.8497206,
		[590] = 106.9446292,
		[591] = 107.0394573,
		[592] = 107.1342053,
		[593] = 107.2288733,
		[594] = 107.3234615,
		[595] = 107.4179701,
		[596] = 107.5123993,
		[597] = 107.6067494,
		[598] = 107.7010204,
		[599] = 107.7952127,
		[600] = 107.8893263,
		[601] = 107.9833616,
		[602] = 108.0773187,
		[603] = 108.1711977,
		[604] = 108.264999,
		[605] = 108.3587226,
		[606] = 108.4523689,
		[607] = 108.5459378,
		[608] = 108.6394298,
		[609] = 108.7328449,
		[610] = 108.8261833,
		[611] = 108.9194452,
		[612] = 109.0126309,
		[613] = 109.1057404,
		[614] = 109.1987741,
		[615] = 109.291732,
		[616] = 109.3846144,
		[617] = 109.4774214,
		[618] = 109.5701532,
		[619] = 109.66281,
		[620] = 109.755392,
		[621] = 109.8478994,
		[622] = 109.9403323,
		[623] = 110.032691,
		[624] = 110.1249756,
		[625] = 110.2171862,
		[626] = 110.3093231,
		[627] = 110.4013865,
		[628] = 110.4933764,
		[629] = 110.5852932,
		[630] = 110.6771369,
		[631] = 110.7689077,
		[632] = 110.8606059,
		[633] = 110.9522315,
		[634] = 111.0437848,
		[635] = 111.135266,
		[636] = 111.2266751,
		[637] = 111.3180124,
		[638] = 111.409278,
		[639] = 111.5004721,
		[640] = 111.5915949,
		[641] = 111.6826465,
		[642] = 111.7736272,
		[643] = 111.864537,
		[644] = 111.9553761,
		[645] = 112.0461447,
		[646] = 112.1368431,
		[647] = 112.2274712,
		[648] = 112.3180293,
		[649] = 112.4085176,
		[650] = 112.4989362,
		[651] = 112.5892852,
		[652] = 112.6795649,
		[653] = 112.7697754,
		[654] = 112.8599169,
		[655] = 112.9499894,
		[656] = 113.0399932,
		[657] = 113.1299285,
		[658] = 113.2197953,
		[659] = 113.3095939,
		[660] = 113.3993243,
		[661] = 113.4889868,
		[662] = 113.5785815,
		[663] = 113.6681086,
		[664] = 113.7575682,
		[665] = 113.8469604,
		[666] = 113.9362855,
		[667] = 114.0255435,
		[668] = 114.1147346,
		[669] = 114.203859,
		[670] = 114.2929168,
		[671] = 114.3819082,
		[672] = 114.4708333,
		[673] = 114.5596922,
		[674] = 114.6484852,
		[675] = 114.7372123,
		[676] = 114.8258737,
		[677] = 114.9144695,
		[678] = 115.003,
		[679] = 115.0914651,
		[680] = 115.1798652,
		[681] = 115.2682003,
		[682] = 115.3564705,
		[683] = 115.4446761,
		[684] = 115.5328171,
		[685] = 115.6208937,
		[686] = 115.7089061,
		[687] = 115.7968543,
		[688] = 115.8847385,
		[689] = 115.9725589,
		[690] = 116.0603155,
		[691] = 116.1480087,
		[692] = 116.2356383,
		[693] = 116.3232047,
		[694] = 116.4107079,
		[695] = 116.4981481,
		[696] = 116.5855255,
		[697] = 116.67284,
		[698] = 116.760092,
		[699] = 116.8472815,
		[700] = 116.9344086,
		[701] = 117.0214735,
		[702] = 117.1084764,
		[703] = 117.1954173,
		[704] = 117.2822963,
		[705] = 117.3691138,
		[706] = 117.4558696,
		[707] = 117.542564,
		[708] = 117.6291972,
		[709] = 117.7157692,
		[710] = 117.8022801,
		[711] = 117.8887302,
		[712] = 117.9751194,
		[713] = 118.0614481,
		[714] = 118.1477162,
		[715] = 118.2339239,
		[716] = 118.3200714,
		[717] = 118.4061587,
		[718] = 118.492186,
		[719] = 118.5781534,
		[720] = 118.6640611,
		[721] = 118.7499091,
		[722] = 118.8356976,
		[723] = 118.9214267,
		[724] = 119.0070966,
		[725] = 119.0927073,
		[726] = 119.178259,
		[727] = 119.2637518,
		[728] = 119.3491858,
		[729] = 119.4345611,
		[730] = 119.5198779,
		[731] = 119.6051363,
		[732] = 119.6903364,
		[733] = 119.7754784,
		[734] = 119.8605622,
		[735] = 119.9455882,
		[736] = 120.0305563,
		[737] = 120.1154667,
		[738] = 120.2003195,
		[739] = 120.2851148,
		[740] = 120.3698528,
		[741] = 120.4545336,
		[742] = 120.5391572,
		[743] = 120.6237239,
		[744] = 120.7082336,
		[745] = 120.7926866,
		[746] = 120.8770829,
		[747] = 120.9614227,
		[748] = 121.045706,
		[749] = 121.129933,
		[750] = 121.2141038,
		[751] = 121.2982185,
		[752] = 121.3822772,
		[753] = 121.4662801,
		[754] = 121.5502272,
		[755] = 121.6341186,
		[756] = 121.7179545,
		[757] = 121.801735,
		[758] = 121.8854602,
		[759] = 121.9691301,
		[760] = 122.052745,
		[761] = 122.1363048,
		[762] = 122.2198098,
		[763] = 122.30326,
		[764] = 122.3866555,
		[765] = 122.4699965,
		[766] = 122.553283,
		[767] = 122.6365152,
		[768] = 122.7196931,
		[769] = 122.8028169,
		[770] = 122.8858866,
		[771] = 122.9689025,
		[772] = 123.0518645,
		[773] = 123.1347728,
		[774] = 123.2176275,
		[775] = 123.3004287,
		[776] = 123.3831765,
		[777] = 123.465871,
		[778] = 123.5485122,
		[779] = 123.6311004,
		[780] = 123.7136356,
		[781] = 123.796118,
		[782] = 123.8785475,
		[783] = 123.9609243,
		[784] = 124.0432486,
		[785] = 124.1255203,
		[786] = 124.2077397,
		[787] = 124.2899068,
		[788] = 124.3720217,
		[789] = 124.4540845,
		[790] = 124.5360954,
		[791] = 124.6180543,
		[792] = 124.6999614,
		[793] = 124.7818169,
		[794] = 124.8636208,
		[795] = 124.9453731,
		[796] = 125.0270741,
		[797] = 125.1087238,
		[798] = 125.1903222,
		[799] = 125.2718696,
		[800] = 125.3533659,
		[801] = 125.4348113,
		[802] = 125.5162059,
		[803] = 125.5975497,
		[804] = 125.678843,
		[805] = 125.7600857,
		[806] = 125.8412779,
		[807] = 125.9224198,
		[808] = 126.0035114,
		[809] = 126.0845529,
		[810] = 126.1655443,
		[811] = 126.2464857,
		[812] = 126.3273772,
		[813] = 126.4082189,
		[814] = 126.4890109,
		[815] = 126.5697534,
		[816] = 126.6504463,
		[817] = 126.7310897,
		[818] = 126.8116839,
		[819] = 126.8922287,
		[820] = 126.9727245,
		[821] = 127.0531711,
		[822] = 127.1335688,
		[823] = 127.2139176,
		[824] = 127.2942176,
		[825] = 127.3744688,
		[826] = 127.4546715,
		[827] = 127.5348256,
		[828] = 127.6149313,
		[829] = 127.6949886,
		[830] = 127.7749976,
		[831] = 127.8549585,
		[832] = 127.9348713,
		[833] = 128.014736,
		[834] = 128.0945529,
		[835] = 128.1743218,
		[836] = 128.2540431,
		[837] = 128.3337167,
		[838] = 128.4133427,
		[839] = 128.4929212,
		[840] = 128.5724522,
		[841] = 128.651936,
		[842] = 128.7313725,
		[843] = 128.8107619,
		[844] = 128.8901042,
		[845] = 128.9693995,
		[846] = 129.0486479,
		[847] = 129.1278495,
		[848] = 129.2070043,
		[849] = 129.2861125,
		[850] = 129.3651741,
		[851] = 129.4441892,
		[852] = 129.5231579,
		[853] = 129.6020802,
		[854] = 129.6809563,
		[855] = 129.7597863,
		[856] = 129.8385701,
		[857] = 129.917308,
		[858] = 129.9959999,
		[859] = 130.074646,
		[860] = 130.1532464,
		[861] = 130.231801,
		[862] = 130.31031,
		[863] = 130.3887735,
		[864] = 130.4671916,
		[865] = 130.5455643,
		[866] = 130.6238917,
		[867] = 130.7021739,
		[868] = 130.780411,
		[869] = 130.858603,
		[870] = 130.93675,
		[871] = 131.0148521,
		[872] = 131.0929094,
		[873] = 131.170922,
		[874] = 131.2488899,
		[875] = 131.3268132,
		[876] = 131.404692,
		[877] = 131.4825264,
		[878] = 131.5603163,
		[879] = 131.638062,
		[880] = 131.7157635,
		[881] = 131.7934209,
		[882] = 131.8710342,
		[883] = 131.9486035,
		[884] = 132.0261289,
		[885] = 132.1036105,
		[886] = 132.1810483,
		[887] = 132.2584424,
		[888] = 132.3357929,
		[889] = 132.4130998,
		[890] = 132.4903633,
		[891] = 132.5675834,
		[892] = 132.6447602,
		[893] = 132.7218937,
		[894] = 132.798984,
		[895] = 132.8760313,
		[896] = 132.9530355,
		[897] = 133.0299967,
		[898] = 133.1069151,
		[899] = 133.1837907,
		[900] = 133.2606235,
		[901] = 133.3374136,
		[902] = 133.4141611,
		[903] = 133.4908661,
		[904] = 133.5675287,
		[905] = 133.6441488,
		[906] = 133.7207266,
		[907] = 133.7972622,
		[908] = 133.8737556,
		[909] = 133.9502069,
		[910] = 134.0266162,
		[911] = 134.1029834,
		[912] = 134.1793088,
		[913] = 134.2555923,
		[914] = 134.3318341,
		[915] = 134.4080342,
		[916] = 134.4841927,
		[917] = 134.5603095,
		[918] = 134.6363849,
		[919] = 134.7124189,
		[920] = 134.7884115,
		[921] = 134.8643629,
		[922] = 134.940273,
		[923] = 135.0161419,
		[924] = 135.0919698,
		[925] = 135.1677566,
		[926] = 135.2435025,
		[927] = 135.3192075,
		[928] = 135.3948717,
		[929] = 135.4704951,
		[930] = 135.5460779,
		[931] = 135.62162,
		[932] = 135.6971215,
		[933] = 135.7725826,
		[934] = 135.8480032,
		[935] = 135.9233834,
		[936] = 135.9987234,
		[937] = 136.0740231,
		[938] = 136.1492827,
		[939] = 136.2245021,
		[940] = 136.2996815,
		[941] = 136.374821,
		[942] = 136.4499205,
		[943] = 136.5249801,
		[944] = 136.6,
		[945] = 136.6749801,
		[946] = 136.7499206,
		[947] = 136.8248215,
		[948] = 136.8996829,
		[949] = 136.9745048,
		[950] = 137.0492872,
		[951] = 137.1240303,
		[952] = 137.1987342,
		[953] = 137.2733988,
		[954] = 137.3480242,
		[955] = 137.4226106,
		[956] = 137.4971579,
		[957] = 137.5716662,
		[958] = 137.6461356,
		[959] = 137.7205661,
		[960] = 137.7949579,
		[961] = 137.8693109,
		[962] = 137.9436253,
		[963] = 138.017901,
		[964] = 138.0921381,
		[965] = 138.1663368,
		[966] = 138.2404971,
		[967] = 138.3146189,
		[968] = 138.3887025,
		[969] = 138.4627478,
		[970] = 138.5367549,
		[971] = 138.6107238,
		[972] = 138.6846547,
		[973] = 138.7585476,
		[974] = 138.8324025,
		[975] = 138.9062195,
		[976] = 138.9799986,
		[977] = 139.05374,
		[978] = 139.1274436,
		[979] = 139.2011096,
		[980] = 139.2747379,
		[981] = 139.3483287,
		[982] = 139.421882,
		[983] = 139.4953979,
		[984] = 139.5688763,
		[985] = 139.6423175,
		[986] = 139.7157213,
		[987] = 139.789088,
		[988] = 139.8624175,
		[989] = 139.9357099,
		[990] = 140.0089652,
		[991] = 140.0821836,
		[992] = 140.155365,
		[993] = 140.2285096,
		[994] = 140.3016173,
		[995] = 140.3746883,
		[996] = 140.4477226,
		[997] = 140.5207202,
		[998] = 140.5936812,
		[999] = 140.6666056,
		[1000] = 140.7394936,
	}
	local true_idx = (target_distance - accum_distance);

	if (true_idx <= 0)
	{
		return 10.0;
	}
	else if (true_idx > 1000)
	{
		return incoming_pattern_table[1000];
	}
	else
	{
		return incoming_pattern_table[true_idx.tointeger()];
	}
}

function self_erase(accum_distance, target_distance)
{
	if ((target_distance - accum_distance) <= -50.0)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function pattern_type(param)
{
	return 0;
}